package com.psmz.iwi.docanalyzer.core.document.entities;

import java.util.HashMap;
import java.util.Map;

public enum NumberOfWordsGroupType {

	SMALL("SMALL", "Mały: Od 0 do 500 słów"), MEDIUM("MEDIUM",
			"Średni: Od 501 do 2000 słów"), BIG("BIG",
			"Duży: Powyżej 2001 słów");

	private static Map<String, NumberOfWordsGroupType> codesMap;
	private String code;
	private String description;

	private NumberOfWordsGroupType(String code, String description) {
		this.code = code;
		this.description = description;
	}

	public String getDescription() {
		return description;
	}

	public String getCode() {
		return code;
	}

	public static NumberOfWordsGroupType getByCode(String code) {
		return codesMap.get(code);
	}

	static {
		codesMap = new HashMap<String, NumberOfWordsGroupType>();
		for (NumberOfWordsGroupType groupType : NumberOfWordsGroupType.values()) {
			codesMap.put(groupType.getCode(), groupType);
		}
	}

}
